<%-- 
    Document   : wrapper
    Created on : 5-apr-2013, 9.25.55
    Author     : Giuseppe
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@page import="ejb.Utente"%>
<html lang="en"><!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript" src="funzioni_javascript.js"></script>
<title>Portale VideoGames</title>

<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.css">



<script src="./bootstrap/js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.js"></script>



<!-- or the full Bootstrap JS if you want other features
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script> -->

<style type="text/css">

*, html {
	margin: 0;padding: 0;
}

body {
	background: #f9f9f9;
}

#wrapper {
	width: 940px;
	min-height: 500px;
	margin: 50px auto;
	padding: 25px;
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 0 1px 1px #eee;
}

	/* dropdown
	------------------------------------------------------- */

.dropdown-menu {
	display: none;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-top: none;
	z-index: 9;
}
.dropdown-menu:hover {
	cursor: pointer;
        display: block;
}
.dropdown-menu li a {
	font-weight: normal;
}
ul.nav li.dropdown:hover ul.dropdown-menu{
    display: block;
}
.pull-right, [class*="span"] .pull-right {
float: right;
}
.pull-left, [class*="span"] .pull-left {
float: left;
}
.container { margin-left: 0px; }

</style>

</head>
<div id="wrapper">

          <div id="navbar-example" class="navbar navbar-static">
            <div class="navbar-inner">
              <div class="container">
                <ul class="nav">
	                <li><a href="#">Home</a></li>
	             	<li>
					<a href="#"><img src="./img/PC.jpg" height="60" width="40"></a>
				  	</li>


				  <li class="dropdown">
					  <a class="dropdown-toggle" href="#" data-toggle="dropdown"><img src="./img/sony.jpg" height="200" width="100"><!--<b class="caret"></b>--></a>
					<ul class="dropdown-menu">
						<li><a href="#">Tutte le console</a></li>
						<li><a href="#">Playstation 3</a></li>
						<li><a href="#">Playstation Vita</a></li>
					</ul>
				  </li>
                  <li class="dropdown">
                    <a class="dropdown-toggle" href="#" data-toggle="dropdown"><img src="./img/nintendo.jpg" height="200" width="100"><!--<b class="caret"></b>--></a>
                    <ul class="sub-menu dropdown-menu">
                      <li><a href="#">Tutte le console</a></li>
                      <li><a href="#">Nintendo 3ds</a></li>
                      <li><a href="#">Nintendo ds</a></li>
                      <li><a href="#">Wii</a></li>
                      <li><a href="#">WiiU</a></li>
                    </ul>
                  </li>
                  	<li>
				  	<a href="#"><img src="./img/android.jpg" height="200" width="100"></a>
				  	</li>
                                        <li>
					<a href="#"><img src="./img/apple.jpg" height="23" width="23"></a>
				  	</li>
					<li><a href="#">Shop</a></li>
				</ul>
                  		            <%
                                           
                           Utente utente = (Utente)session.getAttribute("utente");
                              if(utente!=null){
                                       if(utente.getTipo().equals("u")){%>
                              
				<ul class="nav pull-right">
				          <li class="divider-vertical"></li>
				          <li class="dropdown">
                                              <a class="dropdown-toggle" href="#" data-toggle="dropdown"> <%=utente.getUsername()%> <b class="caret"></b></a>
		                
                                                <ul class="sub-menu dropdown-menu">
                                                  
                                                  <li><a href="#">Vendi articolo</a></li>
                                                  <li><a href="#">Guarda articoli </a></li>
                                                  <li><a href="#">Invia messaggio a utente </a></li>
                                                   <li><a href="#">Casella messaggi </a></li>
                                                   <li><a href="#">Modifica profilo</a></li>
                                                  <li><a href="Controller?button=logout">Logout</a></li>

                                                </ul>
                                             			    

				          </li>
        		</ul>

                              <%}else if(utente.getTipo().equals("r")){
 %>
                              
				<ul class="nav pull-right">
				          <li class="divider-vertical"></li>
				          <li class="dropdown">
                                              <a class="dropdown-toggle" href="#" data-toggle="dropdown">Recensore <%=utente.getUsername()%> <b class="caret"></b></a>
		                
                                                <ul class="sub-menu dropdown-menu">
                                                  <li><a href="#">Aggiungi notizia</a></li>
                                                  <li><a href="#">Modifica notizia</a></li>
                                                  <li><a href="#">Cancella notizia </a></li>
                                                   <li><a href="#">Aggiungi recensione</a></li>
                                                  <li><a href="#">Modifica recensione</a></li>
                                                  <li><a href="#">Cancella recensione </a></li>                                                 
                                                   <li><a href="#">Modifica profilo</a></li>
                                                  <li><a href="Controller?button=logout">Logout</a></li>

                                                </ul>
                                             			    

				          </li>
        		</ul>

                              <%                                 
                              }
                              else{ %>
                              
				<ul class="nav pull-right">
				          <li class="divider-vertical"></li>
				          <li class="dropdown">
                                              <a class="dropdown-toggle" href="#" data-toggle="dropdown"> Amministratore <%=utente.getUsername()%> <b class="caret"></b></a>
		                
                                                <ul class="sub-menu dropdown-menu">
                                                  <li><a href="#">Aggiungi recensore</a></li>
                                                  <li><a href="#">Aggiungi piattaforma</a></li>
                                                  <li><a href="#">Rimuovi utente</a></li>
                                                  <li><a href="#">Cancella recensione </a></li>                                                 
                                                   <li><a href="#">Modifica profilo</a></li>
                                                  <li><a href="Controller?button=logout">Logout</a></li>

                                                </ul>
                                             			    

				          </li>
        		</ul>

                              <%   
                                  
                              }
                              }
                              else{%>
				<ul class="nav pull-right">

				          <li><a href="Controller?button=registrati">Registrati</a></li>
				          <li class="divider-vertical"></li>
				          <li class="dropdown">
				            <a class="dropdown-toggle" href="#" data-toggle="dropdown">Accedi <b class="caret"></b></a>
		                
				            <ul class="sub-menu dropdown-menu">
                                                 <form action="Controller" method="POST" onSubmit="return displayResultLogin(this)">
                                                  
				              <li>  <label>   Username:<input type="text"  placeholder="Username"  name="username" style="width:130px;"></label>
								</li>

					        <li><label>Password:<input type="password" placeholder="Password"  name="pwd" style="width:130px;"></label>
					        <li><label>____________________________</label></li>
                                           <li><label id="errore" style="color: red;"></label> </li>




										<ul class="nav pull-right"><button  class="btn success" type="submit" value="login" name="button">Login</button></ul>
                                                                                </form>
				            </ul>
                                             			    

				          </li>
        		</ul>

                            <% }
                            %>


              </div>
            </div>
          </div> <!-- fine topbar parte condivisa da tutte le pagine-->

